package com.ok.api.client.fallback;

import com.ok.api.client.PrizeClient;
import com.ok.api.client.UserClient;
import com.ok.api.domain.po.OkPrize;
import com.ok.common.domain.po.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * @ClassName PrizeFallback
 * @Description TODO
 * @Author hw
 * @Date 2024/5/24 0:30
 */
@Slf4j
public class PrizeFallback implements FallbackFactory<PrizeClient> {
    @Override
    public PrizeClient create(Throwable cause) {
        return new PrizeClient() {
            @Override
            public Result<OkPrize> prizeInfo(Integer id) {
                log.error("远程调用PrizeClient#prizeInfo方法出现异常");
                return null;
            }
        };
    }
}
